<template>
    <div class="app-pay-card" @click="$emit('check')" :class="{disable: disable}">
        <div class="logo">
            <slot name="logo"></slot>
        </div>
        <div class="pay-type">
            <div class="inner">
                <div class="name">{{type}}</div>
                <div class="introduce">{{introduce}}</div>
            </div>
            <div class="recommend-tag" v-if="recommend">
                <img src="../assets/image/recommend.png">
            </div>
        </div>
        <div class="check-icon" :class="{checked: checked}">
            <img src="../assets/image/choice-empty.png" v-if="!checked">
            <img src="../assets/image/choice-empty.png" style="opacity: 0.4" v-if="checked">
        </div>
    </div>
</template>

<script>
    export default {
        name: "AppPayCard",
        props: {
            type: {
                default: ''
            },
            introduce: {
                type: String,
                default: ''
            },
            checked: {
                type: Boolean,
                default: false
            },
            disable: {
                type: Boolean,
                default: false
            },
            recommend: {
                type: Boolean,
                default: false
            }
        }
    }
</script>

<style lang="scss" scoped>
    .app-pay-card {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 15/3.75+vw;
        background: #fff;
        border-top: 1px solid #dedede;
        border-bottom: 1px solid #dedede;
        &.disable {
            opacity: 0.5;
            pointer-events: none;
        }
        & + .app-pay-card {
            border-top: none;
        }
        .logo {
            width: 35/3.75+vw;
            height: 35/3.75+vw;
            & /deep/ img {
                width: 100%;
                height: 100%;
            }
        }
        .pay-type {
            flex: 1;
            position: relative;
            margin-left: 20/3.75+vw;
            .inner {
                display: flex;
                align-items: flex-start;
                justify-content: flex-start;
                flex-direction: column;
                font-size: 18/3.75+vw;
                .name {
                    color: #000;
                    line-height: 1;
                }
                .introduce {
                    margin-top: 5/3.75+vw;
                    color: #999;
                    font-size: 14/3.75+vw;
                }
            }
            .recommend-tag {
                position: absolute;
                top: 50%;
                left: 150/3.75+vw;
                transform: translateY(-50%);
                width: 39/3.75+vw;
                img {
                    width: 100%;
                }
            }
        }
        .check-icon {
            width: 20/3.75+vw;
            height: 20/3.75+vw;
            img {
                width: 100%;
                height: 100%;
            }
        }
    }
</style>
